home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 26 (Anniversary Edition)
/
Volume 26 [Anniversary Edition] - JOGO DISK .iso
/
DEPOSITO
/
sb_bust.swf
/
scripts
/
__Packages
/
CharacterObj.as
next >
Wrap
Text File
|
2006-07-26
|
1KB
|
45 lines
class CharacterObj
{
function CharacterObj(l_RefMov)
{
this.RefMov = l_RefMov;
this.Nom = this.RefMov._name;
this.State = "Wait";
this.StateOld = "Wait";
this.MaxHealth = 100;
this.Health = 100;
this.CanBeHit = true;
this.NbFace = 3;
this.WillWin = false;
}
function CheckControl()
{
}
function ShowHealth()
{
var _loc3_ = 101 - int(this.Health / this.MaxHealth * 100);
if(_global.C._parent.Interface[this.Nom + "Health"]._currentframe < _loc3_)
{
_global.C._parent.Interface[this.Nom + "Health"].nextFrame();
}
}
function ChangeState(l_NewAction)
{
if(this.StateOld != l_NewAction)
{
this.StateOld = this.State;
this.State = l_NewAction;
this.RefMov.gotoAndStop(l_NewAction);
}
}
function Actions()
{
this.ChangeState(this.State);
this.CheckControl();
this.ChangeState(this.State);
this[this.State]();
this.ChangeState(this.State);
this.ShowHealth();
}
}